package com.lushu.chapitre1.dialogue.nodes
{
	import com.lushu.chapitre1.dialogue.api.INode;
	
	public class NpcNode extends AbstractNode
	{
		public function NpcNode()
		{
			type_ = "npc";
			displayName_ = "npc :";
		}
		
		public override function toXML(level : int = 0) : String
		{
			var tabIndex : String ="";
			for(var j : int = 0; j < level; j++)
			{
				tabIndex+="\t";
			}
			var nodeXML : String = tabIndex+"<npc>";
			var child : INode;
			
			
			for(var i : int = 0; i < children.length; i++)
			{
				child = children[i];
				nodeXML += "\n"+child.toXML(level+1);
			}
			nodeXML += "\n"+tabIndex+"</npc>";
			return nodeXML;
		}
		
		public override function setInformation(value : XML) : void
		{
			
		}
		
		public override function getPotentialChildNodes(node : INode) : Array
		{
			var childIdx : int = children.indexOf(node);
			return [{label :"Npc", data: "text"},{label :"Joueur", data: "joueur"},{label :"Condition", data: "conditionN"}];
		}

	}
}